import request from '@/utils/request'

//计算差旅费用
export const getClvFee = data => {
  return request({
    url:'oa/finance/getClvFee',
    method:'post',
    data,
  })
}

//获取可申请项目
export const getApplyProject = query => {
  return request({
    url:'oa/finance/getApplyProject',
    method:'get',
    params: query,
  })
}

//获取财务项目详情
export const getProjectBase = query => {
  return request({
    url:'oa/finance/getProjectBase',
    method:'get',
    params: query,
  })
}

//添加财务
export const addFinanceData = data => {
  return request({
    url:'oa/finance/addFinanceData',
    method:'post',
    data,
  })
}

//财务列表
export const getFinanceList = query => {
  return request({
    url:'oa/finance/list',
    method:'get',
    params: query,
  })
}

//获取财务详情
export const getFinanceDetail = query => {
  return request({
    url:'oa/finance/detail',
    method:'get',
    params: query,
  })
}

//编辑财务
export const editFinance = data => {
  return request({
    url:`oa/finance/edit/${data.id}`,
    method:'post',
    data,
  })
}

//获取发票列表
export const getTicketList = query => {
  return request({
    url:'oa/finance/ticketList',
    method:'get',
    params: query,
  })
}

//获取发票详情
export const getTicketInfo = query => {
  return request({
    url:'oa/finance/ticketInfo',
    method:'get',
    params: query,
  })
}

//获取差旅费
export const getClvData = query => {
  return request({
    url:'oa/finance/getClvData',
    method:'get',
    params: query,
  })
}

//获取申请记录
export const getApplyLog = query => {
  return request({
    url:'oa/finance/getApplyLog',
    method:'get',
    params: query,
  })
}

//删除发票
export const delFaPiao = data => {
  return request({
    url:'api/delTicket/' + data.id,
    method:'get',
  })
}

//删除财务
export const delFinance = data =>{
  return request({
    url:`oa/finance/del/${data.id}`,
    method:"post"
  })
}

//添加回执单
//编辑财务
export const addFinanceHzd = data => {
  return request({
    url:`oa/finance/add/hzd/${data.id}`,
    method:'post',
    data,
  })
}

//del/hzd/{file}
export const delFinanceHzd = data => {
  return request({
    url:`oa/finance/del/hzd/${data.id}`,
    method:'get',
    data,
  })
}

//del/hzd/{file}
export const delClvAPI = data => {
  return request({
    url:`oa/finance/del/clv/${data.id}`,
    method:'delete',
    data,
  })
}
